public class While01 {

    public static void main(String[] args) {
        // 计算1-100的和
        int num = 1;
        int sum = 0;
        while (num <= 100) {
            sum += num; // sum = sum + num;
            num ++;
        }
        System.out.println("1 - 100 的和是" + sum);

    }
}
